<div class="container" style="width:50%;">

<?php echo $this->session->flash(); ?>

<div class="panel panel-default">
	<table class="table">
		<thead>
			<tr>
				<th>#</th>
				<th>Category Name</th>
				<th>Status</th>
				<th><a href="<?php echo $this->webroot; ?>category/add"><button type="button" class="btn btn-primary">New</button></a></th>
			</tr>
      	</thead>
      
		<tbody>
		
			<?php $index = 0; foreach($list as $item): $index++; ?>
			
				<?php if($index % 2 != 0) { ?>
					<tr class="info">
				<?php } else { ?>
					<tr>
				<?php } ?>
				
					<td>
						<a href="<?php echo $this->webroot; ?>category/edit?id=<?php echo $item['Category']['id']; ?>"><?php echo $item['Category']['id']; ?></a>
					</td>
					
					<td>
						<a href="<?php echo $this->webroot; ?>category/edit?id=<?php echo $item['Category']['id']; ?>"><?php echo $item['Category']['category_name']; ?></a>
					</td>
					
					<td>
						<?php if($item['Category']['delete_flg'] == 0) { ?>
							<span class="label label-success">Active</span>
						<?php } else { ?>
							<span class="label label-default">Unactive</span>
						<?php } ?>
					</td>
					
					<td>
						
						<?php if($item['Category']['delete_flg'] == 0) { ?>
							<a href="<?php echo $this->webroot; ?>category/delete?id=<?php echo $item['Category']['id']; ?>">
								<button type="button" href="sdsd" class="btn btn-danger">Delete</button>
							</a>
						<?php } else { ?>
							<a href="<?php echo $this->webroot; ?>category/active?id=<?php echo $item['Category']['id']; ?>">
								<button type="button" class="btn btn-success">Active</button>
							</a>
						<?php } ?>
							
						
					</td>
				</tr>	
			<?php endforeach; ?>
			
		</tbody>
    </table>
</div>
</div>